package com.m4f.fse.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;


public class Query {
	
	private Container<?> container = null;
	private List<Metadata<?>> resultMetaInformation = new ArrayList<Metadata<?>>();
	private SortedSet<Result<?>> results = new TreeSet<Result<?>>();
	
	//private List <Result<?>> results = new ArrayList<Result<?>>();
	
	public Container<?> getContainer() {
		return this.container;
	}
	
	public void setContainer(Container<?> c) {
		this.container = c;
	}
	
	public void addResult(Result<?> r) {
		//System.out.println("+++Result present: " + this.results.contains(r));
		this.results.add(r);
	}
	
	public Collection<Result<?>> getResults() {
		return Collections.unmodifiableCollection(this.results);
	}
	
	public void addResultMetadata(Metadata<?> metadata) {
		this.resultMetaInformation.add(metadata);
	}
	
	public Collection<Metadata<?>> getResultMetaInformation() {
		return Collections.unmodifiableCollection(this.resultMetaInformation);
	}
}